package com.telit.firecommand.dao;

import com.telit.firecommand.entity.WebsocketPushMsgLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WebsocketPushMsgLogDao {
    int deleteByPrimaryKey(Long id);

    int insert(WebsocketPushMsgLog record);

    int insertSelective(WebsocketPushMsgLog record);

    WebsocketPushMsgLog selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(WebsocketPushMsgLog record);

    int updateByPrimaryKey(WebsocketPushMsgLog record);

    /**
     * 查询所有已读消息
     * @param eventType
     * @param userId
     * @return
     */
    List<Long> queryHasReadMsg(@Param("eventType") Integer eventType, @Param("userId")Long userId);

    /**
     * 查询是否已读
     * @return
     */
    Long queryHasRead(@Param("eventType") Integer eventType,@Param("eventId")Long eventId);
}